﻿using System;
using System.Collections.Generic;
using System.Text;

namespace _08_静态构造函数
{
    class User
    {
        string _userNmae;
        public string UserName
        {
            get { return _userNmae; }
            set
            {
                if (value.Length>15)
                {
                    throw new ArgumentException("用户名长度不能超过15个字符");
                }
                _userNmae = value;
            }
        }

        string _passwrod;
        public string Password
        {
            get { return _passwrod; }
            set
            {
                if (value.Length<8)
                {
                    throw new ArgumentException("密码长度至少要8位");
                }
                _passwrod = value;
            }
        }
    }
}
